<div id="headerdiv">
<!-- /toolbar -->
	<div id="icondiv" class="divleft">K</div>
    
	<div id="categorydiv" class="btn-toolbar">
   		 
            <div class="btn-group">
                <a id="avcoverbtn" class="btn btn-primary category avcover" category="avcover">封面图($!avcovernum)</a>
                <a id="normalbtn" class="btn btn-primary category normal" category="normal">常规图($!normalnum)</a>
                <a id="smallbtn" class="btn btn-primary category small" category="small">小图($!smallnum)</a>
                <a id="longbtn" class="btn btn-primary category long" category="long">长图($!longnum)</a>
                <a id="allbtn" class="btn btn-primary category all" category="all">全部($!allnum)</a> 
            </div>
       </div>
 

<!-- /message --> 
    <div id="messagediv"> 
   		 <span id="messagecountspan"></span>
            <span id="messagea" style="margin-left:10px">1111</span>
	</div>   
    
<!-- /messages --> 
    <div id="messagesdiv" class="span3" style="position:fixed; top:70px; left:600px; width:350px; z-index:1000;"> 
		<a>本页显示$postssize个图片（共 $totalunreadimagesize）</a><br>
	</div>   
    
<!-- /button --> 
    <div id="forumselectdiv"> 
		<a id="forumselectorbtn" href="#" class="btn btn-large btn-block btn-primary">选择论坛</a> 
	</div>
#if($currpage=="picwall")
    <div id="settingdiv"> 
		<a href="#" ><img src="/hezi/images/settingicon.PNG" width="26" alt="setting"></a>
	</div>
#end 
	<div id="changeviewdiv">
    	<a id='columnshowbtn' href='/hezi/postlist' class='btn btn-large btn-block btn-primary'>切换到帖子视图</a>
	</div>

    
    
<!-- /forums -->
    <div id="forumlistdiv" class="tooltip fade bottom in"> 
        <div class="tooltip-arrow">
        </div>
        <div class="tooltip-inner">
  		   #if($currpage=="picwall")
            <div class="spa3n3" style="width:100%; padding-bottom:20px;">
            	所有论坛新图片数: $allforumnewimagecount  快捷操作： 
                <a id="viewallforumavcoverbtn" class="forum btn btn-primary" href="/hezi/picwall?forum=allforum&category=avcover">查看所有论坛封面</a>
                <a id="viewallforummarkedpostbtn" class="forum btn btn-primary" >查看已标记帖子</a>
                
            </div>
            #end 
            <table border="0" style="vertical-align:top">
              <tr>
                #foreach($groupitem in $groupslist)
                <td class="noseprator">
                   <table border="0">
                   	  <!-- /group -->
                      <tr>
                        <td class="group" style="width:140px"><a class="forumgruop btn btn-block btn-primary" id="$groupitem.id">$groupitem.name</a></td>
                        <td class="group" >$groupitem.newimagecount</td>
                      </tr>
                      <!-- /forum -->
                      #foreach($forumitem in $groupitem.getForumsList() )
                      <tr class="count$forumitem.summary.newimagecount">
                     	
                        <td><a id="viewforumbtn$forumitem.getId()" class="forum btn btn-block btn-primary" forumid="$forumitem.getId()">$forumitem.getId()<br>$forumitem.name</a></td>
                        <td>$forumitem.summary.newimagecount</td>
                      </tr>
                      #end
                    </table>
                </td>
                #end
                
           
                
                
           
              </tr>
              
          
            </table>
            <div id="counttogger" class="spa3n3" style="width:150px; padding-top:20px">
            	<label class="checkbox" for="countcheckbox">
            		<input type="checkbox" checked="checked" value="" id="countcheckbox">
            		隐藏无新图的论坛
          		</label>
            </div>
     
    
        </div>
    </div>


</div>
<script language="javascript">


$(function(){

	

		
	
	$("#forumselectorbtn").click(function(){
		$("#forumlistdiv").toggle();
		ltkonclick($(this));
	});
	
	$("#forumlistdiv a").click(function(){
		$("#forumlistdiv").toggle();
	});
	
	$("#counttogger").click(function(){
		if($("#countcheckbox").attr('checked') == 'checked'){
			var v = $("#countcheckbox").attr('checked');
			console.log(v);
			$("tr.count0").hide();
		}
		else{
			console.log("un");
			$("tr.count0").show();
		}
		ltkonclick($(this));
		
	});
	
	
	
	docategory();
	doforumselect();
})


function docategory(){
	//category切换菜单
	$('a.$category').addClass("active");
	
	$("a.category").click(function(){
		category = $(this).attr("category");
		ltkonclick($(this));
		window.location.href="/hezi/picwall?action=view&category="+category+"&windowwidth="+$(window).width();		
	});
}


function doforumselect(){

	$("a.forum").click(function(){
		var forumid = $(this).attr("forumid");
		console.log(forumid);
		ltkonclick($(this));
		window.location.href="/hezi/picwall?forum=" + forumid;	
	});
	
	
	var forumstr = "$!forum.getId() $!forum.getName()";
	if(forumstr.length > 2){
		$("#forumselectorbtn").html(forumstr);
	}
	

}

function notice(data){
	$("#messagea").html(data);	
	$("#messagesdiv").append("<span>" + data + "</span><br>");
	$("#messagecountspan").html( $("#messagesdiv span").length);
	$("#messagediv").show();
			
}

function messagecallback(){
	$("#messagediv").show();
	$("#messagecountspan").html( $("#messagesdiv span").length);
}

</script>
<style>


td {
	text-align:left;
}
td.noseprator {
	vertical-align:top;
	padding-right:10px;
	padding-left:10px;
}

td.seprator{
	border-left:#CCC solid 2px;
	
}

td.group{
	border-bottom:#CCC solid 2px;
	
}




</style>
